package com.cby.operation.pay.bean

import android.os.Parcel
import android.os.Parcelable

/**
 * Description:快爆支付配置
 *
 * @author 陈宝阳
 * @create 2020/8/6 15:03
 */
data class PayConfig(

    /**
     * "gameId": 9763,
     * "gameName": "0811快爆SDK最新",
     * "moneyName": "点券",
     * "moneyRate": 2131,
     * "channels": [
     * "wechatH5",
     * "alipay"
     * ],
     * "maintenanceContent": "支付维护中",
     * "maintenanceStartTime": "2020-08-12 17:15:00",
     * "maintenanceEndTime": "2020-08-12 17:15:02"
     */

    /**
     * 支付的方式
     */
    var payChannels: List<String>? = null,

    /**
     * 游戏币名称
     */
    var moneyName: String? = null,

    /**
     * 支付比例
     */
    var moneyRate: String? = null,

    /**
     * 联系方式
     */
    var contact: String? = null,

    /**
     * 支付维护文案
     */
    var maintenanceContent: String? = null,

    /**
     * 下单失败，需要展示（“重新查询订单”按钮）的支付方式
     */
    var payRetries: List<String>? = null

) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.createStringArrayList(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.createStringArrayList()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeStringList(payChannels)
        parcel.writeString(moneyName)
        parcel.writeString(moneyRate)
        parcel.writeString(contact)
        parcel.writeString(maintenanceContent)
        parcel.writeStringList(payRetries)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<PayConfig> {
        override fun createFromParcel(parcel: Parcel): PayConfig {
            return PayConfig(parcel)
        }

        override fun newArray(size: Int): Array<PayConfig?> {
            return arrayOfNulls(size)
        }
    }


}